<template>
    <div>
        <h1>{{ abc.someState.Dname }}</h1>
        <h1>科室管理</h1>
        <div>
            <tr>
                <td>科室名称</td>
                <td>
                    <input type="text" v-model="info.name">
                </td>
                <td>
                    <input type="button" value="查询" class="btn btn-warning"  @click="gettype">
                </td>
            </tr>
        </div>
        <table class="table table-bordered">
            <tbody>
                <tr>
                <td>科室名称</td>
                <td>科室图片</td>
                <td>成立日期</td>
            </tr>
            <tr v-for="item in list"> 
                <td>{{ item.Tname }}</td>
                <td>
                    <img :src="item.ImgUrl" width="100" height="100">
                </td>
                <td>{{ item.Tdate.substring(0,10) }}</td> 
            </tr>
            </tbody>
        </table>
    </div>
</template>

<script setup lang="ts">
import {ref,reactive, onMounted}from 'vue'
import axios from 'axios'
import { useRoute,useRouter } from 'vue-router';
import { isTemplateExpression } from 'typescript';
import {useStore}from '@/stores/user'
const route = useRoute();
const router = useRouter();
const abc:any = useStore();
let info:any=reactive({
    name:""
});

let list:any=ref([]);

onMounted(()=>{
    gettype();
})

const gettype=()=>{
    axios({
        url:"/api/Use/GetType",
        method:"get",
        data:info
    })
    .then((res)=>{
        console.log(res);
        list.value = res.data;
    })
    .catch((err)=>{
        console.log(err);
    })
}


</script>

<style scoped>

</style>